<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../jquery.min.js"></script>
</head>

<body>
    <a href="https://www.bilibili.com/" title="我想看b站">我想看b站</a>
    <input type="checkbox" checked>
    <div index="1">div</div>
    <script>
        $(function() {
            console.log($("a").prop("href")); //获取属性值
            $("a").prop("title", "我太想看b站"); //设置
            $("input").change(function() {
                console.log($(this).prop("checked"));
            })
            console.log($("div").attr("index"));
            $("div").attr("index", 4);

        })
    </script>
</body>

</html>